import {
    request
} from './index';

export const createClickActionTask = (clickAction, resove, reject) => {
    request.post({
        url: '/task/click-action',
        data: clickAction,
        success: resove,
        error: reject
    })
}

export const getAllClickActionTask = (resove, reject) => {
    request.get({
        url: '/task/click-action',
        success: resove,
        error: reject
    })
}

export const execClickActionTask = (id, resove, reject) => {
    request.put({
        url: '/task/click-action/' + id,
        data: '',
        success: resove,
        error: reject
    })
}


export const findClickAction = (name, resove, reject) => {
    request.get({
        url: '/click-action/' + name,
        success: resove,
        error: reject
    })
}

export const getPageJumpList = (name, resove, reject) => {
    request.get({
        url: '/page-jump/' + name,
        success: resove,
        error: reject
    })
}

export const addPageJumpTask = (pageJumpTask, resove, reject) => {
    request.post({
        url: '/task/page-jump',
        data: pageJumpTask,
        success: resove,
        error: reject
    })
}

export const getPageJumpTaskList = (resove, reject) => {
    request.get({
        url: '/task/page-jump',
        success: resove,
        error: reject
    })
}

export const execPageJumpTask = (id, resove, reject) => {
    request.put({
        url: '/task/page-jump/' + id,
        data: '',
        success: resove,
        error: reject
    })
}

export const createAdClickTask = (adClickTask, resove, reject) => {
    request.post({
        url: '/task/ad-click',
        data: adClickTask,
        success: resove,
        error: reject
    })
}

export const getAdClickTaskList = (resove, reject) => {
    request.get({
        url: '/task/ad-click',
        success: resove,
        error: reject
    })
}


export const execAdClickTask = (id, resove, reject) => {
    request.put({
        url: '/task/ad-task/' + id,
        data: '',
        success: resove,
        error: reject
    })
}

export const createSearchWordTask = (searchWordTask, resove, reject) => {
    request.post({
        url: '/task/search-word-task',
        data: searchWordTask,
        success: resove,
        error: reject
    })
}

export const getSearchWordTakList = (resove, reject) => {
    request.get({
        url: '/task/search-word-task',
        success: resove,
        error: reject
    })
}

export const execSearchWordTask = (id, resove, reject) => {
    request.put({
        url: '/task/search-word-task/' + id,
        data: '',
        success: resove,
        error: reject
    })
}